<?php
    /*
        实现当前导航高亮显示
    */
    $curr_url=$_SERVER['PHP_SELF'];
    //获取当前文件名称
    $basename=basename($curr_url);
?>
<!--公共头部-->
<nav class="navbar navbar-default navbar-fixed-top">
    <!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. -->
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">图片在线管理</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-6">
            <ul class="nav navbar-nav">
            <li 
            <?php 
                if($basename=='list.php'):
            ?> 
            class="active"
            <?php
            endif;
            ?>
            
            ><a href="list.php">图片列表</a></li>
            <li 
            <?php 
                if($basename=='upload.php'):
            ?> 
            class="active"
            <?php
            endif;
            ?>
            ><a href="upload.php">图片上传</a></li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div>
</nav>